package demo.model;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;

import generated.CHAPTER;
import generated.VERS;

public class Chapter {

	public static Chapter createFromZefania(CHAPTER chapter) {
		return new Chapter(chapter);
	}

	public BigInteger id;
	public List<Verse> verses = new ArrayList<Verse>();
	
	private Chapter(CHAPTER chapter){
		this.id = chapter.getCnumber();
		
		// Read verses
		for(Object element : chapter.getPROLOGOrCAPTIONOrVERS()){
			if(element instanceof VERS){
				VERS verse = (VERS)element;
				verses.add(Verse.createFromZefania(verse));
			}
		}
		
	}

}
